package com.googlecode.lightest.core

import org.testng.ISuite
import org.testng.xml.XmlSuite

/**
 * In contrast to the TestNG IReporter, which is intended to generate a single
 * report after all tests have finished running, this interface defines a report
 * that can be updated throughout the test run. generateBaseReport() is called
 * to initialize the report, and some flavor of updateReport() is invoked both
 * after a suite starts, and after each test finishes.
 */
interface ILightestReporter {
    
    /**
     * Sets the textual configuration used to configure this run.
     * 
     * @param configText  the textual configuration, or null
     */
    void setConfigText(String configText)
    
    /**
     * Performs one-time setup activities for the report.
     * 
     * @param testRegistry  the registry contains all known information about
     *                      pending tests.
     * @param outputDir
     */
    void generateBaseReport(TestRegistry testRegistry, String outputDir)
    
    /**
     * Updates the report at the beginning of a new suite run.
     * 
     * @param suite         the suite that is about to run
     * @param testRegistry  the registry contains all known information about
     *                      pending and completed tests
     * @param outputDir
     */
    void updateReport(ISuite suite, TestRegistry testRegistry, String outputDir)
    
    /**
     * Updates the report following the generation of a new test result.
     * 
     * @param result        the result for which to update the report.
     * @param testRegistry  the registry contains all known information about
     *                      pending and completed tests
     * @param outputDir
     */
    void updateReport(LightestTestResult result, TestRegistry testRegistry,
        String outputDir)
}